from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action
from items.potion import ImmortalityPotion

class StartingPoint(Room):
    
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        self.add_item(ImmortalityPotion())
        # build list of actions
        self.add_action(StartToGate)
    
    # return description of room.
    def get_description(self):
        return '''
        You entered the secret chamber of Emperor QinShi's tomb, the entrance you came in was shut down.
        There is only one Big Stone Door on the other side of room. 
        But you found a special item in this room - Potion of Immortality.
        '''
    # return image of room
    def get_image(self):
        return 'potion.jpg'
         

class StartingPointHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return StartingPoint

# define actions for this room

class StartToGate(Action):
    def __init__(self):
        Action.__init__(self, "starttogate")    # do basic initialization for every action
           
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to Stone Door"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return "socketedgate"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"